import Vue from 'vue'
import Router from 'vue-router'

// import TestComponent from '@/components/testcomponent'
import Home from '@/pages/Home'
// import Middle from '@/pages/Home/components/Middle'
// import Aticals from '@/pages/Home/components/ArticalList'
import Login from '@/pages/Login'
import UserCenter from '@/pages/Usercenter/Usercenter'
import EmailValid from '@/pages/EmailValid/index'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Home,
      name: 'Home'
    },
    {
      path: '/home',
      component: Home,
      name: 'Home'
    },
    // {
    //   path: '/',
    //   name: 'Home',
    //   component: Home,
    //   children: [
    //     {
    //       // 当 /user/:id/profile 匹配成功，
    //       // UserProfile 会被渲染在 User 的 <router-view> 中
    //       path: 'home',
    //       component: Middle
    //     },
    //     {
    //       // 当 /user/:id/posts 匹配成功
    //       // UserPosts 会被渲染在 User 的 <router-view> 中
    //       path: 'articals/:id',
    //       component: Aticals
    //     }
    //   ]
    // },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/user-center',
      component: UserCenter,
      name: 'UserCenter',
      meta: {
        title: 'User Center'
      }
    },
    {
      path: '/email-valid/:userid',
      component: EmailValid,
      name: 'EmailValid',
      meta: {
        title: '邮箱验证'
      }
    }
    // {
    //   path: '/test:name',
    //   name: 'Test Page',
    //   component: TestComponent
    // }
  ]
})
